<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
        <title>Personal Application</title>
    </head>
    <body>
        <?php
            session_start();
            include "config.php";
            //cek username apakah ada di database atau nggak
            
            $user = $_POST['user'];
            $passwd = $_POST['passwd'];
            
            //print "<strong>checking</strong>";
            
            $query = "select * from users where nama = '$user'";
            $exec = mysql_query($query);
            $result = mysql_fetch_array($exec);
            
            $num = mysql_num_rows($exec);
            
            if($user != $result['nama'] ) {
                header("location: index.php");
            } else {
                $_SESSION['user'] = $user;
                header("location: home.php");
            }
        ?>
    </body>
</html>
